Start Task Action Icon

Start Task Action

Declaration

<AMSTARTTASK MANAGEDTASK="taskname" TASKFILE="text">

See Also

Stop Task, Create Variable

Description

Starts another task using the task name specified. Public variables from the parent task are available to the newly started task.

Practical Usage

Used to start a second task from a "parent" task. Especially useful for code reuse so the same code does not have to be written over and over again - rather one task can be created and called repeatedly.

Parameters

General Tab

Start a managed task
Text, Optional
MARKUP:
a) MANAGEDTASK="Talking Clock"
b) MANAGEDTASK="Foldername\Talking Clock"
 

Specifies the name of the managed task to start. The task must exist in the current machines task list at runtime or the step will fail.  
NOTE: changing the task name or parent folder name later can break this linkage once created.

Run a task file
Text, Optional
MARKUP: TASKFILE="C:\Documents and Settings\All Users.WINDOWS\Documents\My AutoMate Tasks\closeallwindows.aml"

Specifies the path and filename to an unmanaged task (.aml file) that should be run.

An unmanaged task is a task that was created using the Task Builder  - but was not added to the Task Administrator.  When using task modules for code reuse - using this option makes more sense because code modules normally do not need to be triggered (they are only called from other tasks), thus, there is no reason to add them to the Task Administrator.  In most cases, only the "parent" task should added to the Task Administrator, sub tasks (i.e. task modules that are made only to be reused) are better stored in a designated location on the hard disk or network and called by their filename.  To create an unmanaged task - simply start the task builder directly from the AutoMate 5 program group, when started in this manner, menu options such as Open, Save and Save As are available.

Notes

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Example

<AMSTARTTASK MANAGEDTASK="Say the time">
<AMSTARTTASK TASKFILE="c:\My tasks\speakthetime.aml">